import com.sheng.domian.User;
import com.sheng.service.UserService;
import com.sheng.service.impl.UserServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

//设定spring 专用的类加载器
@RunWith(SpringJUnit4ClassRunner.class)
//设定加载的spring上下文对应配置
@ContextConfiguration("classpath:applicationContext.xml")
public class txst {

    @Autowired
    private UserService userService;

    @Test
    public void testFindById() {
        User user = userService.get(1);
        System.out.println(user);
    }


}
